<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
   <%@page import="sever.*,entity.*,java.util.*"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
 <%@   include file ="dengluyanzheng.jsp" %>
<table border="1" cellpadding="0" cellspacing="0">

             <tr>
                 <td>学号</td><td>姓名</td><td>性别</td><td>手机号</td><td>qq</td><td>微信</td>
                 <td>年级号</td><td>入学日期</td><td>城市</td><td>出生日期</td>
                 <td>地址</td><td>密码</td>
             </tr>
             <%
               StudentService service=new StudentService();
             int pageNo=1; 
       
             try{
            	   pageNo=Integer.parseInt(request.getParameter("pageNo"));
            	 }catch(Exception e){}
            	 
              List<Student> l= service.fenye2(pageNo, 20,null,null, null);
              int total=service.zongshu();
              int pageTotal=total/20+(total%20==0?0:1);//总页数
              
              
              
        
             for(Student s:l){
            	 %>
            	 <tr>
            	   <td><%=s.getStuno() %></td><td><%=s.getSname() %></td><td><%=s.getSex() %></td><td><%=s.getTelephone() %></td>
            	  <td><%=s.getQq() %></td> <td><%=s.getWechat() %></td> <td><%=s.getGradeid() %></td> <td><%=s.getEnterdate() %></td>
            	 <td><%=s.getFromcity() %></td>  <td><%=s.getBirthday() %></td>  <td><%=s.getAddress() %></td> <td><%=s.getPass() %></td>
            	   <td>   <a href="StudentAddbiandan.jsp" >新增</a></td>
            	   <td>   <a onclick="return window.confirm('确定要删除吗？')" href="StudentDel.jsp?stuno=<%=s.getStuno() %>" >删除</a></td>
            	   <td>   <a  href="StudentUpdatebiaodan.jsp?stuno=<%=s.getStuno()%>">修改</a></td>
            	 </tr>
            	 
            	 <%} %>
            	
         </table>
          <%
              if(pageNo>1){
    
              %>
               <a href="student.jsp?pageNo=<%=pageNo-1%>"> 上页</a>
              <%} %>
            	 <%
            	    if(pageTotal>pageNo){
            	    	
            	 %>
            	 <a href="student.jsp?pageNo=<%=pageNo+1%>"> 下页</a>
            	 <% } %>
            	  <a href="student.jsp?pageNo=<%=pageTotal %>"> 尾页</a> 
           
</body>
</html>